package com.systop.component;

/**
 * @Description: TODO
 * @Author: jsj
 * @Date: 2023/2/20
 */

import com.baomidou.mybatisplus.core.injector.AbstractMethod;
import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
import com.baomidou.mybatisplus.core.metadata.TableInfo;
import com.baomidou.mybatisplus.extension.injector.methods.InsertBatchSomeColumn;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 拓展mybatisPlus 支持批量插入
 */
@Component
public class ExpandSqlInjector extends DefaultSqlInjector {
    // @Override
    // public List<AbstractMethod> getMethodList(Class<?> mapperClass) {
    //     List<AbstractMethod> methodList = super.getMethodList(mapperClass);
    //     methodList.add(new InsertBatchSomeColumn());
    //     return methodList;
    // }
    @Override
    public List<AbstractMethod> getMethodList(Class<?> mapperClass, TableInfo tableInfo) {
        List<AbstractMethod> methodList = super.getMethodList(mapperClass, tableInfo);
        methodList.add(new InsertBatchSomeColumn());
        return methodList;
    }



}
